
#include "processBar.h"

void processbar(int speed)
{
    char bar[NUM]={'\0'};
    //memset(bar,'\0',sizeof(bar));
    const char* lable="|/-\\";
    int len=strlen(lable);
    int cnt=0;
    while(cnt<=TOP)
    { 
        printf("[%-100s][%d%%][%c]\r",bar,cnt,lable[cnt%len]);
        fflush(stdout);
        bar[cnt++]=STYLE;
        if(cnt<TOP)
        {
            bar[cnt]=TEMP;
        }
        usleep(speed);
    }
    printf("\n");
}
